//
//  ByLoginViewModel.h
//  Homept_ios
//
//  Created by mc on 16/9/19.
//  Copyright © 2016年 pro. All rights reserved.
//

#import "ByBaseViewModel.h"
#import "ByNetUserApi.h"        // 用户接口
#import "ByNetCodeApi.h"        //用户验证码接口

#pragma mark - 协议
// 登录协议
@protocol LoginDelegate <NSObject>
@required
- (void)loginSuccess:(ByNetBaseResult *)result;
@optional
- (void)loginFail:(ByNetBaseResult *)result;
@end

// 注册协议
@protocol RegisterDelegate <NSObject>
@required
- (void)registerSuccess:(ByNetBaseResult *)result;
@optional
- (void)registerFail:(ByNetBaseResult *)result;
@end

//发送验证码协议
@protocol FetchCodeDelegate <NSObject>
@required
- (void)fetchCodeSuccess:(ByNetBaseResult *)result;
@optional
- (void)fetchCodeFail:(ByNetBaseResult *)result;
@end

//验证验证码协议
@protocol CheckCodeDelegate <NSObject>
@required
- (void)checkCodeSuccess:(ByNetBaseResult *) result;
@optional
- (void)checkCodeFail:(ByNetBaseResult *)result;
@end


//个人资料更新
@protocol PersonUpdateDelegate <NSObject>
@required
- (void)personUpdateSuccess:(ByNetBaseResult *) result;
@optional
- (void)personUpdateFail:(ByNetBaseResult *) result;
@end

//个人资料更新
@protocol BoundMobileDelegate <NSObject>
@required
- (void)boundMobileSuccess:(ByNetBaseResult *) result;
@optional
- (void)boundMobileFail:(ByNetBaseResult *) result;
@end


//上传头像
@protocol IconUpLoadDelegate <NSObject>
- (void)iconUpSuccess:(ByNetBaseResult *) result;
@optional
- (void)iconUpFail:(ByNetBaseResult *) result;
@end


//找回密码
@protocol FindBackPswDelegate <NSObject>
- (void)findBackPswSuccess:(ByNetBaseResult *) result;
@optional
- (void)findBackPswFail:(ByNetBaseResult *) result;
@end

//实名认证
@protocol RealNameAttestationDelegate <NSObject>
- (void)uploadIDImagesSuccess:(ByNetBaseResult *) result;
- (void)realNameAttestationSuccess:(ByNetBaseResult *) result;
@optional
- (void)uploadIDImagesFail:(ByNetBaseResult *) result;
- (void)realNameAttestationFail:(ByNetBaseResult *) result;
@end


// 获取用户信息
@protocol GetUserNewInfoDelegate <NSObject>
- (void)getUserNewInfoSuccess:(ByNetBaseResult *) result;
@optional
- (void)getUserNewInfoFail:(ByNetBaseResult *) result;
@end



// 提交意见反馈
@protocol FeedbackDelegate <NSObject>
- (void)feedbackSuccess:(ByNetBaseResult *) result;
@optional
- (void)feedbackFail:(ByNetBaseResult *) result;
@end


#pragma mark - vm
@interface ByLoginViewModel : ByBaseViewModel
@property (nonatomic, weak) id<LoginDelegate>     loginDelegate;
@property (nonatomic, weak) id<RegisterDelegate>  registerDelegate;
@property (nonatomic, weak) id<FetchCodeDelegate> fetchcodeDelegate;
@property (nonatomic, weak) id<CheckCodeDelegate> checkcodeDelegate;
@property (nonatomic, weak) id<PersonUpdateDelegate> personUpdateDelegate;
@property (nonatomic, weak) id<BoundMobileDelegate> boundMobileDelegate;
@property (nonatomic, weak) id<IconUpLoadDelegate> iconUpLoadDelegate;
@property (nonatomic, weak) id<FindBackPswDelegate> findBackPswDelegate;
@property (nonatomic, weak) id<RealNameAttestationDelegate> realNameAttestationDelegate;
@property (nonatomic, weak) id<GetUserNewInfoDelegate> getUserNewInfoDelegate;
@property (nonatomic, weak) id<FeedbackDelegate> feedbackDelegate;

/*
 外部接口方法
 */
// 登录
- (void)login:(ByNetParamsModel *)model;

// 注册
- (void)registe:(ByNetParamsModel *)model;

//发送验证码
- (void)fetchCode:(ByNetParamsModel *)model;

//验证验证码
- (void)checkCode:(ByNetParamsModel *)model;

//个人资料更新
- (void)updatePersonData:(ByNetParamsModel *)model;

//绑定手机
- (void)boundMobile:(ByNetParamsModel *)model;

//上传头像
- (void)upLoadMyIcon:(UIImage *)icon;

// 找回密码
- (void)findBackPassword:(ByNetParamsModel *)model;

// 实名认证
// 第一步
- (void)uploadIDImages:(NSArray *)images;
// 第二步
- (void)realNameAttestation:(ByNetParamsModel *)model;


// 获取用户信息
- (void)getNewUserInfo:(ByNetParamsModel *)model;

// 提交意见反馈
- (void)feedback:(ByNetParamsModel *)model;


@end
